package com.lglbc.mybatispluslearning.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.lglbc.mybatispluslearning.configuration.MyListTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author 乐哥聊编程
 * @since 2022-07-18
 */
@TableName(value = "manage_user", autoResultMap = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ManageUser implements Serializable {

    private static final long serialVersionUID = 1L;
    @TableId
    private Long id;
    @TableField(value = "(mobile)",
            insertStrategy = FieldStrategy.NEVER,
            updateStrategy = FieldStrategy.NEVER,
            select = false)
    private int count;
    @TableField(fill = FieldFill.INSERT)
    private String createBy;


    private Boolean delFlag;
    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
    @TableField(typeHandler = MyListTypeHandler.class)
    private List<Permission> permission;
    private String avatar;

    private Long departmentId;

    private String description;

    private String email;
    @TableField(javaType = false, jdbcType = JdbcType.VARCHAR)
    private String mobile;

    private String nickName;

    private String password;

    private String sex;

    private Boolean status;

    private String userName;

}
